import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from "@vitejs/plugin-vue-jsx";
import { resolve } from 'path';

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue(), vueJsx()],
  resolve: {//配置别名,需要配置tsconfig.json文件，compilerOptions中编辑器会自动读取
    alias: [
      {
        find: '@',
        replacement: resolve(__dirname, 'src')
      },
    ]
  },
  server: {
    host: '0.0.0.0',
    proxy: {
      '/api': {
        target: 'http://geo.datav.aliyun.com/areas_v3/areas_v3/bound/geojson',
        changeOrigin: true,
        rewrite: path => path.replace(/^\/api/, '')
      }
    }
  }
})
